<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" class="signin no-js" lang="zh_CN">
<head>
    <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
    <title th:text="${order.siteName}+' - 正在支付'"></title>
    <meta name="keywords" th:content="${config.keywords}">
    <meta name="description" th:content="${config.decText}">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="/static/css/register.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="/static/css/font.css">
    <link rel="stylesheet" href="/static/css/xadmin.css">
    <script src="/static/js/jquery-1.11.3.min.js"></script>
    <style>
        .login-bg {
            background: url(/images/bg.png) no-repeat center;
            background-size: cover;
            overflow: hidden;
            text-align: center;
        }
    </style>
</head>
<body class="login-bg">
<h3 style="font-size: 40px;color: greenyellow;padding-top: 40px;">正在支付,请稍后...</h3><br>
</body>
<script th:inline="javascript">
    $(function () {
        if (typeof WeixinJSBridge == "undefined") {
            if (document.addEventListener) {
                document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
            } else if (document.attachEvent) {
                document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
                document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
            }
        } else {
            onBridgeReady();
        }
    });

    function onBridgeReady() {
        WeixinJSBridge.invoke(
            'getBrandWCPayRequest', {
                "appId": "[(${wx_model.appId!})]",
                "timeStamp": "[(${wx_model.timeStamp!})]",
                "nonceStr": "[(${wx_model.nonceStr!})]",
                "package": "[(${wx_model.package})]",
                "signType": "[(${wx_model.signType})]",
                "paySign": "[(${wx_model.sign})]"
            },
            function (res) {
                if (res.err_msg === "get_brand_wcpay_request:ok") {
                    window.location = "/payment/return_page?out_trade_no=[(${order.outOrderId!})]&times=" + new Date().getTime();
                } else {
                     alert("信息:" + res.err_desc);
                    // alert("信息:"+res.err_msg);
                    window.location = "/payment/return_page?out_trade_no=[(${order.outOrderId!})]&times=" + new Date().getTime();
                }
            }
        );
    }
</script>
</html>

